<?php


namespace app\api\model;

use think\db\exception\DbException;

class MovieItem extends BaseApiModel
{
    protected $table = "data_movie_item";

    /**
     * 搜索电影
     * @param $param
     * @return array
     * @throws DbException
     */
    public function searchMovie($param){
        $translatedName = $param['translatedName'] ?? null;
        $movieName = $param['movieName'] ?? null;
        $condition = [
            'translatedName'=>['translatedName', 'like', "%$translatedName%"],
            'movieName'=>['movieName', 'like', "%$movieName%"],
        ];
        return $this->toPaginate($param, $condition);
    }

}